﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ly.Scheduler.NewService
{
    public class BackgroundJob
    {
        public Guid? Id { get; set; }
        public string Name { get; set; }
        public string Parameters { get; set; }
        /// <summary>
        /// 调用的类库
        /// </summary>
        public string JobType { get; set; }
        /// <summary>
        /// 状态 0 不可用 1 可用  2 任务运行中 3 任务运行结束  4 暂停中 5 暂停 
        /// </summary>
        public int Status { get; set; }

        public string Description { get; set; }
        /// <summary>
        ///动作：添加、更新、删除、运行一次、暂停
        /// </summary>
        public string Action { get; set; }
        //public DateTime CreateTime { get; set; }
        //public string CreateBy { get; set; }
        //public DateTime ModifyTime { get; set; }
        //public string ModifyBy { get; set; }

        public List<JobTrigger> trigger { get; set; }
    }
    public class JobTrigger
    {
        public JobTrigger()
        {
            Status = 1;
        }
        public Guid? Id { get; set; }
        public Guid? JobId { get; set; }
        public string Name { get; set; }
        public string CronExpression { get; set; }
        public string Description { get; set; }

        /// <summary>
        /// 状态 0 不可用 ，1 可用
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 状态 inserted 0 ,deleted 2 ,updated 1
        /// </summary>
        public int _status { get; set; }
        //public DateTime CreateTime { get; set; }
        //public string CreateBy { get; set; }
        //public DateTime ModifyTime { get; set; }
        //public string ModifyBy { get; set; }
    }
}
